home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Panorama / Panorama - Disk 01 (1986-02-15)(Pacific North-West Amigas Club)[h AFL][b corrupt files].zip / Panorama - Disk 01 (1986-02-15)(Pacific North-West Amigas Club)[h AFL][b corrupt files].adf / pipe.doc < prev    next >
Text File  |  1989-10-24  |  4KB  |  110 lines

  1.  
  2.                       PIPE
  3.  
  4. Pipe - program to connect the output of one program to the input of
  5.        another.
  6.  
  7. Syntax
  8.  
  9. Pipe [@] pgm1 [@o] [file] [options] | pgm2 [@<][@o][@s] [options]...| \
  10.          pgmn [@<] [file] [options]
  11.  
  12. Description
  13.  
  14. A pipe is a temporary RAM file that is created by one program and passed
  15. as information to another program.  This file is entirely controlled by
  16. the program Pipe and is transparent to the user.  This eliminates the
  17. need for the user to create temporary files to pass information to other
  18. programs.  Pipe effectively turns most commands and programs into 
  19. MS-DOS/XENIX-like filters - ie - they take standard input
  20. (keyboard) and standard output (screen).  It's left to the users' in-
  21. genuity to find effective uses.
  22.  
  23. Pipe is capable of handling not only standard input and output, but
  24. command line input and output.  Pipe knows CLI requirements (version
  25. 1.1).  For other programs, the default is command line input and
  26. standard output.  Either or both may be changed with command line
  27. options.  Program name followed by @< changes the input for that pro-
  28. gram to redirected standard input (file as opposed to keyboard).
  29. @o changes the output of the program to command line output.  @s indi-
  30. cates the output is the same file as the input, such as the i/o of Ed.
  31. They may be specified separately - eg - @< @o, or together - eg - @<o.
  32. If specified separately, spaces must be inserted between them.  In add-
  33. ition, these options must appear immediately following the program
  34. name.  For any non-CLI command (last in the pipeline) having command
  35. line output, this may be redirected to the screen by specifying *.
  36. @ immediately following the Pipe command itself will list the
  37. commands as they execute.
  38.  
  39. Programs are separated by (space) | (space).  The user, where applic-
  40. able, must specify the input of the first program and the output of
  41. the last program in the pipeline.  If no output for the last is spec-
  42. ified, the default will be the screen.  There may be no "input" spec-
  43. ified for some commands, such as Dir and List.  Standard command options
  44. may be entered, but must follow input for the first command in the pipe
  45. line and output for the last command.  Input and output names may NOT
  46. be specified for commands and programs enclosed by | (vertical bar) -
  47. that is handled by Pipe itself and is transparent to the user.  A temp-
  48. orary RAM file for the last command may be created by using a closing
  49. |.  In this case, the file "RAM:pipetemp" will be created.
  50.  
  51. After the final command, Pipe deletes any temporary files (exept RAM:
  52. pipetemp) created previously, thus relieving the user of tracking
  53. and deleting temporary files that would have to be created if the
  54. commands were run separately.
  55.  
  56. Some commands are more useful than others for piping; for example -
  57. it makes no sense whatsoever to use the Copy command, unless you get
  58. off on watching the disk drive light flicker.  Following is a list of
  59. allowable CLI commands and their constraints.
  60.  
  61. s = standard i/o; c = command line i/o.
  62.  
  63. COMMAND  INPUT  OUTPUT  MUST BE: FIRST or LAST (not filters)
  64.  
  65. ASSIGN            s                 x
  66. COPY        c     c
  67. DATE              c&s               x
  68. DELETE            s                 x
  69. DIR               c&s               x
  70. INFO              s                 x
  71. INSTALL           s                 x
  72. JOIN        c     c
  73. LIST              s                 x
  74. MORE        c     c                          x
  75. SEARCH      c     s
  76. SORT        c     c
  77. STATUS            s                 x
  78. TEE               c                 (cannot be first)
  79. TYPE        c     c&s                        x
  80.  
  81. Examples
  82.  
  83. pipe @ list | sort | more
  84.  
  85. The output of list is passed to sort, which is sorted and passed to
  86. standard output a screenfull at a time.  The commands are listed as
  87. they execute.
  88.  
  89. pipe search myfile "for any string" | MyProg @<o | type prt: opt n
  90.  
  91. The output of search is passed to MyProg, which accepts both redirected
  92. input and command line output, massaged and passed to type, which
  93. produces a line numbered listing to the printer.
  94.  
  95. pipe MyProg myfile | join b c | sort
  96.  
  97. MyProg uses myfile as command line input, the output is passed to join,
  98. which concatenates b and c to same and passes the resulting output to
  99. sort, which lists the sorted file to the screen.
  100.  
  101. pipe dir c | wc -w
  102.  
  103. Lists the number of commands in the c directory.
  104.  
  105. pipe dir opt d | wc -l
  106.  
  107. Lists the number of directories immediately subordinate to the current
  108. directory.
  109.  
  110.